//
//  HLJRefesh.m
//  B段项目
//
//  Created by 111111 on 16/1/4.
//  Copyright © 2016年 张智超. All rights reserved.
//

#import "HLJRefesh.h"

@implementation HLJRefesh
-(instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        [self createSubView];
    }
    return self;
}


#pragma mark - 子视图
-(void)createSubView{
    
    self.backgroundColor = [UIColor whiteColor];
    
    //准备数据
    NSMutableArray *imageArray = [NSMutableArray array];
    
    
    for (int i = 0; i < 26; i++) {
        
        
        NSString *name = [NSString stringWithFormat:@"refresh%d.png",i];
        
        //UIImage是图片类,存数据的,不能显示
        //UIImageView是显示Image对象的类
        UIImage *image = [UIImage imageNamed:name];
        
        [imageArray addObject:image];
        
        
    }
    
    
    //小僵尸动画
    self.zoomImageView1 = [[UIImageView alloc]init];
    self.zoomImageView1.size = CGSizeMake(40, 40);
    self.zoomImageView1.center = CGPointMake(self.width / 2, (self.height - 80) / 2);
    
    [self addSubview:self.zoomImageView1];
    
    //设置播放图片数组
    self.zoomImageView1.animationImages = imageArray;
    
    //设置播放时长
    self.zoomImageView1.animationDuration = 5;
    
    //重复次数,0为不限次数
    self.zoomImageView1.animationRepeatCount = 0;//一直播放
    
    //开始播放
    [self.zoomImageView1 startAnimating];

    
}

@end
